package 华为练习;

import java.util.Scanner;

/**
 * Created by hest0 on 2017/7/12.
 */
public class 查找组成一个偶数最接近的两个素数 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            System.out.println(func(n));
        }
        sc.close();
    }

    private static String func(int n) {
        int diff = Integer.MAX_VALUE;
        int x = 0;
        int y = 0;
        for (int i = 2; i <= n / 2; i++) {
            if (isPrim(i) && isPrim(n - i)) {
                if (diff >= (n - i) - i) {
                    x = i;
                    y = n - i;
                }
            }
        }
        return String.valueOf(x) + "\n" + String.valueOf(y);
    }

    private static boolean isPrim(int a) {
        boolean flag = true;
        if (a < 2) {
            return false;
        } else {
            for (int i = 2; i <= Math.sqrt(a); i++) {
                if (a % i == 0) {
                    flag = false;
                    break;
                }
            }
        }
        return flag;
    }

}
